var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("LoadRes"),
    a = e("sdkConfig"),
    i = (function () {
        function e() {
            (this.SW_SystemBanner = !1),
                (this.SW_SystemInters = !1),
                (this.SW_Video = !1),
                (this.SW_Native = !1),
                (this.SW_NativeBanner = !1),
                (this.SW_NativeInters = !1),
                (this.SW_CustomSwitch = !1),
                (this.SW_Box = !1),
                (this.SW_Block = !1),
                (this.SW_BigNative = !1),
                (this.SW_IconNative = !1),
                (this.ID_SystemBanner = ""),
                (this.ID_SystemInters = ""),
                (this.ID_Native = ""),
                (this.ID_NativeCustom = ""),
                (this.ID_AdCustomId = ""),
                (this.ID_Video = ""),
                (this.ID_Box = ""),
                (this.ID_Block = ""),
                (this.NUM_NativeIntersP = 0),
                (this.NUM_NativeIntersReport = 1),
                (this.NUM_BannerErrP = 0),
                (this.NUM_BannerErrMost = 0),
                (this.NUM_BannerErrMust = 0),
                (this.NUM_VideoErrP = 0),
                (this.NUM_VideoErrMost = 0),
                (this.NUM_VideoErrMust = 0),
                (this.NUM_BannerUpdateTime = 30),
                (this.SW_SystemBannerFirst = !0),
                (this.NUM_BannerMostShow = 99),
                (this.SW_IntersBaseControl = !1),
                (this.NUM_IntersStart = 0),
                (this.NUM_IntersIntervalNum = 0),
                (this.NUM_IntersIntervalTime = 0),
                (this.NUM_IntersDelayTime = 0),
                (this.NUM_IntersDelayP = 0),
                (this.NUM_NativeUpdateTime = 30),
                (this.SW_AddDesktop = !1),
                (this.SW_IntersIntervalToAddDesktop = !1),
                (this.NUM_AutoAddDeskMostTimes = 0),
                (this.NUM_IntersToAddDesktopNumber = 0),
                (this.SW_Statistics = !0),
                (this.SW_NavigateIcon = !1),
                (this.SW_NavigateGroup = !1),
                (this.SW_NavigateSettle = !1),
                (this.pushGameList = []),
                (this.bannerAd = null),
                (this.loadSucc_Banner = !1),
                (this.loadSucc_SystemBanner = !1),
                (this.loadSucc_NativeBanner = !1),
                (this.hasShowBanner = !1),
                (this.isShow_SystemBanner = !1),
                (this.isShow_NativeBanner = !1),
                (this.interval_updateBanner = null),
                (this.timeout_checkBannerLoadSucc = null),
                (this.NUM_CheckBannerLoadSucc = 0),
                (this.NUM_MaxCheckBannerLoadSucc = 5),
                (this.NUM_BannerClose = 0),
                (this.timeout_showSystemBanner = null),
                (this.systemIntersAd = null),
                (this.loadSucc_SystemInters = !1),
                (this.NUM_SystemIntersLoadError = 0),
                (this.customIntersAd = null),
                (this.loadSucc_CuctomInters = !1),
                (this.NUM_CustomIntersLoadError = 0),
                (this.videoAd = null),
                (this.loadSucc_Video = !1),
                (this.callback_Video = null),
                (this.timeout_loadVideo = null),
                (this.nativeAd = null),
                (this.customNativeAd = null),
                (this.loadSucc_NativeIcon = !1),
                (this.isShow_NativeIcon = !1),
                (this.isShow_NativeImage = !1),
                (this.loadSucc_NativeImage = !1),
                (this.nativeAdInfo = null),
                (this.firstNativeAdInfo = null),
                (this.customNativeAdInfo = null),
                (this.param_nativeIcon = null),
                (this.timeout_updateNativeIcon = null),
                (this.timeout_updateNativeImage = null),
                (this.node_nativeIcon = null),
                (this.node_nativeImage = null),
                (this.customNativeAdIdArray = [""]),
                (this.nativeOtherRes = null),
                (this.loadSucc_NativeOther = !1),
                (this.nativeBannerRes = null),
                (this.node_nativeBanner = null),
                (this.nativeIntersRes = null),
                (this.loadSucc_NativeInters = !1),
                (this.node_nativeInters = null),
                (this.NUM_hasShowInters = 0),
                (this.NUM_intersNowInterval = 0),
                (this.NUM_IntersNowIntervalTime = 0),
                (this.NUM_IntersNowToAddDesktop = 0),
                (this.navigateBoxBannerAd = null),
                (this.loadSucc_NavigateBoxBanner = !1),
                (this.navigateBoxPortalAd = null),
                (this.loadSucc_NavigateBoxPortal = !1),
                (this.temp_hasShowBanner = !1),
                (this.isShow_NavigateSettle = !1),
                (this.InterErrSwitch = null),
                (this.inter_Err_Num = 0),
                (this.miniGame_version = "101"),
                (this.AdGroup = ""),
                (this.app_test_version = !1);
        }
        return (
            (e.prototype.GameVersion = function (e) {
                this.app_test_version = this.miniGame_version == e;
            }),
            (e.prototype.getGameTestVersion = function () {
                return this.app_test_version;
            }),
            (e.prototype.createAd = function () {
                this.SW_SystemBanner && "" != this.ID_SystemBanner && this.createSystemBanner(),
                    this.SW_SystemInters && "" != this.ID_SystemInters && this.createSystemInters(),
                    this.NUM_IntersIntervalTime > 0 && this.runIntersInterval(),
                    this.SW_Box && "" != this.ID_Box && this.createNavigateBoxPortal(),
                    this.SW_Block && "" != this.ID_Block && this.createNavigateBoxBanner(),
                    this.SW_Video && "" != this.ID_Video && this.createVideo(),
                    this.SW_Native && "" != this.ID_Native && (this.createNative(), this.loadNativeOtherRes()),
                    this.SW_Native &&
                        "" != this.ID_Native &&
                        (this.SW_NativeBanner && this.loadNativeBannerRes(),
                        this.SW_NativeInters && this.loadNativeInterRes()),
                    this.SW_CustomSwitch && "" != this.ID_AdCustomId && this.createNativeCuston(),
                    qg.setKeepScreenOn({
                        keepScreenOn: !0,
                        success: function () {
                            console.log("handling success");
                        }
                    });
            }),
            (e.prototype.startLoadPushGamaes = function () {}),
            (e.prototype.createSystemBanner = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_SystemBanner)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道系统banner广告ID中含有空字符串,请检查后台系统banner广告ID*********************"
                      )
                    : ((this.bannerAd = qg.createBannerAd({posId: this.ID_SystemBanner, style: {}})),
                      this.bannerAd.onLoad(function () {
                          (e.loadSucc_SystemBanner = !0), console.log("ChaoQiGameSDK", "VIVO 系统banner加载成功");
                      }),
                      this.bannerAd.onError(function (t) {
                          console.log("ChaoQiGameSDK", "VIVO 系统banner加载失败：", JSON.stringify(t)),
                              30007 == t.errCode &&
                                  (console.log("ChaoQiGameSDK", "VIVO 系统banner广告播放次数已达限制"),
                                  (e.loadSucc_SystemBanner = !1),
                                  e.hideSystemBanner(),
                                  e.showBanner());
                      }),
                      this.bannerAd.onClose(function () {
                          console.log("ChaoQiGameSDK", "VIVO 系统banner关闭", e.NUM_BannerUpdateTime + "S之后再次刷新"),
                              e.NUM_BannerClose++,
                              e.hideBanner();
                      }));
            }),
            (e.prototype.createSystemInters = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_SystemInters)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道系统插屏广告ID中含有空字符串,*********************"
                      )
                    : ((this.systemIntersAd = qg.createInterstitialAd({posId: this.ID_SystemInters})),
                      this.systemIntersAd.onLoad(function () {
                          console.log("ChaoQiGameSDK", "VIVO 系统插屏广告加载完成"), (e.loadSucc_SystemInters = !0);
                      }),
                      this.systemIntersAd.onError(function (t) {
                          e.NUM_SystemIntersLoadError++,
                              (e.loadSucc_SystemInters = !1),
                              console.log(
                                  "ChaoQiGameSDK",
                                  e.NUM_SystemIntersLoadError,
                                  "VIVO 系统插屏加载失败：",
                                  JSON.stringify(t)
                              ),
                              e.NUM_SystemIntersLoadError < 5 &&
                                  setTimeout(function () {
                                      e.createSystemInters();
                                  }, 1e4);
                      }),
                      this.systemIntersAd.onClose(function () {
                          console.log("ChaoQiGameSDK", "VIVO 系统插屏广告关闭"),
                              (e.NUM_IntersNowIntervalTime = 0),
                              (e.loadSucc_SystemInters = !1),
                              setTimeout(function () {
                                  e.createSystemInters();
                              }, 4e3);
                      }));
            }),
            (e.prototype.createVideo = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_Video)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道视频广告ID中含有空字符串,请检查后台视频广告ID*********************"
                      )
                    : ((this.videoAd = qg.createRewardedVideoAd({posId: this.ID_Video})),
                      this.videoAd.onLoad(function () {
                          console.log("ChaoQiGameSDK", "VIVO 视频广告加载完成"), (e.loadSucc_Video = !0);
                      }),
                      this.videoAd.onError(function (t) {
                          console.log("ChaoQiGameSDK", "VIVO 视频加载失败：", JSON.stringify(t)),
                              e.callback_Video && (e.callback_Video(null), (e.callback_Video = null)),
                              (e.loadSucc_Video = !1),
                              setTimeout(function () {
                                  e.videoAd && e.videoAd.load();
                              }, 3e3);
                      }),
                      this.videoAd.onClose(function (t) {
                          t.isEnded
                              ? (console.log("ChaoQiGameSDK", "VIVO 激励视频广告完成，发放奖励"),
                                e.callback_Video && (e.callback_Video(!0), (e.callback_Video = null)))
                              : (console.log("ChaoQiGameSDK", "VIVO 激励视频广告取消关闭，不发放奖励"),
                                e.callback_Video && (e.callback_Video(!1), (e.callback_Video = null))),
                              (e.loadSucc_Video = !1),
                              setTimeout(function () {
                                  e.videoAd && e.videoAd.load();
                              }, 3e3);
                      }));
            }),
            (e.prototype.createNative = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_Native)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道原生广告ID中含有空字符串,请检查后台原生广告ID*********************"
                      )
                    : ((this.nativeAd = qg.createNativeAd({posId: this.ID_Native})),
                      (this.nativeAdInfo = {
                          adId: null,
                          title: null,
                          desc: null,
                          Native_icon: null,
                          Native_BigImage: null
                      }),
                      (this.firstNativeAdInfo = {
                          adId: null,
                          title: null,
                          desc: null,
                          Native_icon: null,
                          Native_BigImage: null
                      }),
                      this.nativeAd.onLoad(function (t) {
                          console.log("ChaoQiGameSDK", "VIVO 原生广告加载成功", JSON.stringify(t.adList));
                          var o = 0;
                          if (null != typeof t.adList && 0 != t.adList.length) {
                              if (
                                  ((o = t.adList.length - 1),
                                  console.log("ChaoQiGameSDK", "VIVO 原生广告拉取:" + JSON.stringify(t.adList[o])),
                                  "" != t.adList[o].icon && 0 != t.adList[o].imgUrlList.length
                                      ? console.log("ChaoQiGameSDK", "VIVO 同时存在原生ICON和大图")
                                      : console.log("ChaoQiGameSDK", "VIVO 只存在原生ICON或大图"),
                                  (e.firstNativeAdInfo.adId = String(t.adList[o].adId)),
                                  (e.firstNativeAdInfo.title = String(t.adList[o].title)),
                                  (e.firstNativeAdInfo.desc = String(t.adList[o].desc)),
                                  (e.nativeAdInfo.adId = String(t.adList[o].adId)),
                                  (e.nativeAdInfo.title = String(t.adList[o].title)),
                                  (e.nativeAdInfo.desc = String(t.adList[o].desc)),
                                  "" != t.adList[o].icon)
                              ) {
                                  var a = function (t) {
                                      console.log("ChaoQiGameSDK", "VIVO 原生ICON加载成功"),
                                          (e.nativeAdInfo.Native_icon = t),
                                          (e.loadSucc_NativeIcon = !0);
                                  };
                                  n.default.loadResCustom(String(t.adList[o].imgUrlList[0]) + "?.png", a),
                                      (e.firstNativeAdInfo.Native_icon = String(t.adList[o].icon));
                              } else
                                  (e.nativeAdInfo.Native_icon = null),
                                      (e.loadSucc_NativeIcon = !1),
                                      (e.firstNativeAdInfo.Native_icon = null);
                              0 != t.adList[o].imgUrlList.length
                                  ? ((a = function (t) {
                                        console.log("ChaoQiGameSDK", "VIVO 原生大图加载成功"),
                                            (e.nativeAdInfo.Native_BigImage = t),
                                            (e.loadSucc_NativeImage = !0);
                                    }),
                                    n.default.loadResCustom(String(t.adList[o].imgUrlList[0]) + "?.png", a),
                                    (e.firstNativeAdInfo.Native_BigImage = String(t.adList[o].imgUrlList[0])))
                                  : ((e.nativeAdInfo.Native_BigImage = null),
                                    (e.loadSucc_NativeImage = !1),
                                    (e.firstNativeAdInfo.Native_BigImage = null));
                          } else console.log("ChaoQiGameSDK", "VIVO 原生广告列表为空 return");
                      }),
                      this.nativeAd.onError(function (e) {
                          console.log("ChaoQiGameSDK", "VIVO 原生广告加载失败：", JSON.stringify(e));
                      }),
                      this.nativeAd.load(),
                      this.nativeAdAutoUpdate());
            }),
            (e.prototype.createCustomNative = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_NativeCustom)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道自定义原生广告ID中含有空字符串,请检查后台自定义原生广告ID*********************"
                      )
                    : this.ID_Native != this.ID_NativeCustom
                    ? ((this.customNativeAd = qg.createNativeAd({posId: this.ID_NativeCustom})),
                      (this.customNativeAdInfo = {
                          adId: null,
                          title: null,
                          desc: null,
                          Native_icon: null,
                          Native_BigImage: null
                      }),
                      this.customNativeAd.onLoad(function (t) {
                          console.log("ChaoQiGameSDK", "VIVO 自定义原生广告加载成功：", JSON.stringify(t.adList));
                          var o = 0;
                          null != typeof t.adList && 0 != t.adList.length
                              ? ((o = t.adList.length - 1),
                                (e.customNativeAdInfo.adId = String(t.adList[o].adId)),
                                (e.customNativeAdInfo.title = String(t.adList[o].title)),
                                (e.customNativeAdInfo.desc = String(t.adList[o].desc)),
                                e.customNativeAdIdArray.unshift(e.customNativeAdInfo.adId),
                                t.adList && "" != t.adList[o].icon
                                    ? (e.customNativeAdInfo.Native_icon = t.adList[o].icon)
                                    : (e.customNativeAdInfo.Native_icon = null),
                                t.adList && t.adList[o].imgUrlList.length > 0
                                    ? (e.customNativeAdInfo.Native_BigImage = t.adList[o].imgUrlList[0])
                                    : (e.customNativeAdInfo.Native_BigImage = null))
                              : console.log("ChaoQiGameSDK", "VIVO 自定义原生广告列表为空 return");
                      }),
                      this.customNativeAd.onError(function (e) {
                          console.log("ChaoQiGameSDK", "VIVO 自定义原生广告加载失败：", JSON.stringify(e));
                      }),
                      this.customNativeAd.load(),
                      this.customNativeAdAutoUpdate())
                    : console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道原生广告ID和自定义原生广告ID相同,请检查后台原生与自定义原生广告ID*********************"
                      );
            }),
            (e.prototype.createNavigateBoxBanner = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_Block)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道互推盒子横幅广告ID中含有空字符串,请检查后台互推盒子横幅广告ID*********************"
                      )
                    : qg.createBoxBannerAd
                    ? ((this.navigateBoxBannerAd = qg.createBoxBannerAd({posId: this.ID_Block})),
                      this.navigateBoxBannerAd.onLoad(function () {
                          console.log("ChaoQiGameSDK", "VIVO 互推盒子横幅广告加载完成"),
                              (e.loadSucc_NavigateBoxBanner = !0);
                      }),
                      this.navigateBoxBannerAd.onError(function (t) {
                          (e.loadSucc_NavigateBoxBanner = !1),
                              console.log("ChaoQiGameSDK", "VIVO 互推盒子横幅广告出错:", JSON.stringify(t)),
                              setTimeout(function () {
                                  e.createNavigateBoxBanner();
                              }, 1e4);
                      }),
                      this.navigateBoxBannerAd.onClose(function () {
                          (e.isShow_NavigateSettle = !1), e.temp_hasShowBanner && e.showBanner();
                      }))
                    : console.log("ChaoQiGameSDK", "VIVO 版本较低,不支持互推盒子广告");
            }),
            (e.prototype.createNavigateBoxPortal = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_Box)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道互推盒子九宫格广告ID中含有空字符串,请检查后台互推盒子九宫格广告ID*********************"
                      )
                    : qg.createBoxPortalAd
                    ? ((this.navigateBoxPortalAd = qg.createBoxPortalAd({posId: this.ID_Box, marginTop: 150})),
                      this.navigateBoxPortalAd.onLoad(function () {
                          console.log("ChaoQiGameSDK", "VIVO 互推盒子九宫格广告加载完成"),
                              (e.loadSucc_NavigateBoxPortal = !0);
                      }),
                      this.navigateBoxPortalAd.onError(function (t) {
                          console.log("ChaoQiGameSDK", "VIVO 互推盒子九宫格广告加载/展示失败：", JSON.stringify(t)),
                              (e.loadSucc_NavigateBoxPortal = !1),
                              setTimeout(function () {
                                  e.createNavigateBoxPortal();
                              }, 1e4);
                      }),
                      this.navigateBoxPortalAd.onClose(function () {
                          console.log("ChaoQiGameSDK", "VIVO 互推盒子九宫格广告关闭"),
                              e.navigateBoxPortalAd.isDestroyed || e.showNavigateBoxPortal();
                      }))
                    : console.log("ChaoQiGameSDK", "VIVO 版本较低,不支持互推盒子广告");
            }),
            (e.prototype.createNativeCuston = function () {
                var e = this;
                a.default.stringHasSpace(this.ID_AdCustomId)
                    ? console.log(
                          "ChaoQiGameSDK",
                          "channelId:",
                          a.default.channelId,
                          "当前渠道原生模板插屏广告ID中含有空字符串,*********************"
                      )
                    : qg.createCustomAd &&
                      ((this.customIntersAd = qg.createCustomAd({
                          posId: this.ID_AdCustomId,
                          style: {left: cc.winSize.width / 2 - 150, top: 100}
                      })),
                      this.customIntersAd.onLoad(function () {
                          console.log("ChaoQiGameSDK", "VIVO 原生模板插屏广告加载完成"), (e.loadSucc_CuctomInters = !0);
                      }),
                      this.customIntersAd.onError(function (t) {
                          e.NUM_CustomIntersLoadError++,
                              (e.loadSucc_CuctomInters = !1),
                              console.log(
                                  "ChaoQiGameSDK",
                                  e.NUM_CustomIntersLoadError,
                                  "VIVO 原生模板广告加载失败",
                                  JSON.stringify(t)
                              ),
                              e.NUM_CustomIntersLoadError < 5 &&
                                  setTimeout(function () {
                                      e.createNativeCuston();
                                  }, 1e4);
                      }),
                      this.customIntersAd.onClose(function () {
                          console.log("ChaoQiGameSDK", "VIVO 原生模板插屏广告关闭"),
                              (e.NUM_CustomIntersLoadError = 0),
                              (e.loadSucc_CuctomInters = !1),
                              setTimeout(function () {
                                  e.createNativeCuston();
                              }, 1e3);
                      }));
            }),
            (e.prototype.loadNativeBannerRes = function () {
                var e = this;
                (this.nativeBannerRes = {
                    NativeBannerBg: null,
                    NativeBannerButton: null,
                    NativeClose: null,
                    NativeAdTip: null
                }),
                    n.default.loadResArray(
                        [
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeBannerBg.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeBannerButton.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeClose.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeAdTip.png"
                        ],
                        function (t, o) {
                            (e.nativeBannerRes.NativeBannerBg = o[0]),
                                (e.nativeBannerRes.NativeBannerButton = o[1]),
                                (e.nativeBannerRes.NativeClose = o[2]),
                                (e.nativeBannerRes.NativeAdTip = o[3]),
                                (e.loadSucc_NativeBanner = !0);
                        }
                    );
            }),
            (e.prototype.loadNativeInterRes = function () {
                var e = this;
                (this.nativeIntersRes = {
                    NativeInterMask: null,
                    NativeIntersBg: null,
                    NativeIntersButton: null,
                    NativeIntersClose: null
                }),
                    n.default.loadResArray(
                        [
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeInterMask.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeIntersBg.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeIntersButton.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeIntersClose.png"
                        ],
                        function (t, o) {
                            (e.nativeIntersRes.NativeInterMask = o[0]),
                                (e.nativeIntersRes.NativeIntersBg = o[1]),
                                (e.nativeIntersRes.NativeIntersButton = o[2]),
                                (e.nativeIntersRes.NativeIntersClose = o[3]),
                                (e.loadSucc_NativeInters = !0);
                        }
                    );
            }),
            (e.prototype.loadNativeOtherRes = function () {
                var e = this;
                (this.nativeOtherRes = {NativeAdTip: null, NativeClose: null}),
                    n.default.loadResArray(
                        [
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeAdTip.png",
                            "https://adinfo-1305586391.file.myqcloud.com/SDK/SDKImage/Native1/NativeClose.png"
                        ],
                        function (t, o) {
                            (e.nativeOtherRes.NativeAdTip = o[0]),
                                (e.nativeOtherRes.NativeClose = o[1]),
                                (e.loadSucc_NativeOther = !0);
                        }
                    );
            }),
            (e.prototype.showBanner = function () {
                if (this.loadSucc_Banner)
                    return this.NUM_BannerMostShow <= this.NUM_BannerClose
                        ? (console.log(
                              "ChaoQiGameSDK",
                              "banner最大关闭次数",
                              this.NUM_BannerMostShow,
                              " 已达上限 return"
                          ),
                          void (this.interval_updateBanner && clearInterval(this.interval_updateBanner)))
                        : void (this.hasShowBanner
                              ? console.log("ChaoQiGameSDK", "已经调用过showBanner,请勿重复调用")
                              : ((this.hasShowBanner = !0),
                                this.SW_SystemBanner && this.SW_NativeBanner
                                    ? this.SW_SystemBannerFirst
                                        ? this.loadSucc_SystemBanner
                                            ? this.showSystemBanner()
                                            : this.loadSucc_NativeBanner &&
                                              (console.log("ChaoQiGameSDK", "系统banner未加载完成,改为展示原生banner"),
                                              this.showNativeBanner())
                                        : this.loadSucc_NativeBanner
                                        ? this.showNativeBanner()
                                        : this.loadSucc_SystemBanner &&
                                          (console.log("ChaoQiGameSDK", "原生banner未加载完成,改为展示系统banner"),
                                          this.showSystemBanner())
                                    : this.SW_SystemBanner
                                    ? this.showSystemBanner()
                                    : this.SW_NativeBanner && this.showNativeBanner(),
                                this.updateBanner()));
                this.checkBannerLoadSucc();
            }),
            (e.prototype.hideBanner = function () {
                (this.hasShowBanner = !1),
                    this.hideNativeBanner(),
                    this.hideSystemBanner(),
                    this.interval_updateBanner && clearInterval(this.interval_updateBanner),
                    this.timeout_showSystemBanner && clearTimeout(this.timeout_showSystemBanner),
                    this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc);
            }),
            (e.prototype.getIntersFlag = function () {
                return (
                    (this.loadSucc_NativeInters && (this.loadSucc_NativeIcon || this.loadSucc_NativeImage)) ||
                    this.loadSucc_SystemInters ||
                    this.loadSucc_CuctomInters
                );
            }),
            (e.prototype.showInters = function () {
                var e = this;
                if (
                    (console.log("====showInters====="),
                    this.NUM_hasShowInters++,
                    this.SW_IntersIntervalToAddDesktop &&
                        this.NUM_hasShowInters <= this.NUM_IntersToAddDesktopNumber &&
                        (console.log(
                            "ChaoQiGameSDK",
                            "第" + this.NUM_IntersToAddDesktopNumber + "次插屏变添加桌面",
                            "当前第" + this.NUM_hasShowInters + "次"
                        ),
                        this.NUM_hasShowInters == this.NUM_IntersToAddDesktopNumber))
                )
                    this.getAddDesktopFlag(function (t) {
                        t && (console.log("ChaoQiGameSDK", "插屏变添加桌面"), e.addDesktop(function () {}));
                    });
                else {
                    if (this.SW_IntersBaseControl) {
                        if (this.NUM_hasShowInters < this.NUM_IntersStart)
                            return void console.log(
                                "ChaoQiGameSDK",
                                "插屏开始次数未达到",
                                this.NUM_hasShowInters,
                                "目标次数",
                                this.NUM_IntersStart
                            );
                        if (this.NUM_intersNowInterval < this.NUM_IntersIntervalNum)
                            return (
                                console.log(
                                    "ChaoQiGameSDK",
                                    "插屏间隔次数未达到",
                                    this.NUM_intersNowInterval,
                                    "目标次数",
                                    this.NUM_IntersIntervalNum
                                ),
                                void this.NUM_intersNowInterval++
                            );
                        if (this.NUM_IntersNowIntervalTime < this.NUM_IntersIntervalTime)
                            return (
                                console.log(
                                    "ChaoQiGameSDK",
                                    "插屏间隔时间未达到",
                                    this.NUM_IntersNowIntervalTime,
                                    "目标时间",
                                    this.NUM_IntersIntervalTime
                                ),
                                void (
                                    this.SW_AddDesktop &&
                                    this.NUM_IntersNowToAddDesktop < this.NUM_AutoAddDeskMostTimes &&
                                    this.getAddDesktopFlag(function (t) {
                                        t &&
                                            (e.NUM_IntersNowToAddDesktop++,
                                            e.addDesktop(function () {
                                                console.log("ChaoQiGameSDK", "插屏间隔弹桌面");
                                            }));
                                    })
                                )
                            );
                    }
                    (this.NUM_intersNowInterval = 0),
                        (this.SW_NativeInters && this.SW_CustomSwitch) ||
                        (this.SW_NativeInters && this.SW_SystemInters) ||
                        (this.SW_CustomSwitch && this.SW_SystemInters)
                            ? Math.floor(100 * Math.random()) >= this.NUM_NativeIntersP
                                ? this.loadSucc_SystemInters
                                    ? this.NUM_IntersDelayTime > 0 &&
                                      Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                        ? setTimeout(function () {
                                              e.SW_NativeInters ? e.showCustomInters() : e.showSystemInters();
                                          }, this.NUM_IntersDelayTime)
                                        : this.SW_NativeInters
                                        ? this.showCustomInters()
                                        : this.showSystemInters()
                                    : this.loadSucc_NativeInters &&
                                      (this.loadSucc_NativeIcon || this.loadSucc_NativeImage) &&
                                      (this.NUM_IntersDelayTime > 0 &&
                                      Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                          ? setTimeout(function () {
                                                e.SW_NativeInters ? e.showNativeInters() : e.showCustomInters();
                                            }, this.NUM_IntersDelayTime)
                                          : this.SW_NativeInters
                                          ? this.showNativeInters()
                                          : this.showCustomInters())
                                : this.loadSucc_NativeInters && (this.loadSucc_NativeIcon || this.loadSucc_NativeImage)
                                ? this.NUM_IntersDelayTime > 0 &&
                                  Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                    ? setTimeout(function () {
                                          e.SW_NativeInters ? e.showNativeInters() : e.showCustomInters();
                                      }, this.NUM_IntersDelayTime)
                                    : this.SW_NativeInters
                                    ? this.showNativeInters()
                                    : this.showCustomInters()
                                : this.loadSucc_SystemInters &&
                                  (this.NUM_IntersDelayTime > 0 &&
                                  Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                      ? setTimeout(function () {
                                            e.SW_NativeInters ? e.showNativeInters() : e.showCustomInters();
                                        }, this.NUM_IntersDelayTime)
                                      : this.SW_NativeInters
                                      ? this.showNativeInters()
                                      : this.showCustomInters())
                            : this.SW_SystemInters
                            ? this.loadSucc_SystemInters &&
                              (this.NUM_IntersDelayTime > 0 && Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                  ? (console.log("ChaoQiGameSDK", "插屏延迟时间(ms):" + this.NUM_IntersDelayTime),
                                    setTimeout(function () {
                                        e.showSystemInters();
                                    }, this.NUM_IntersDelayTime))
                                  : this.showSystemInters())
                            : this.SW_CustomSwitch
                            ? this.loadSucc_CuctomInters &&
                              (this.NUM_IntersDelayTime > 0 && Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                  ? (console.log("ChaoQiGameSDK", "插屏延迟时间(ms):" + this.NUM_IntersDelayTime),
                                    setTimeout(function () {
                                        e.showCustomInters();
                                    }, this.NUM_IntersDelayTime))
                                  : this.showCustomInters())
                            : this.SW_NativeInters
                            ? this.loadSucc_NativeInters &&
                              (this.loadSucc_NativeIcon || this.loadSucc_NativeImage) &&
                              (this.NUM_IntersDelayTime > 0 && Math.floor(100 * Math.random()) < this.NUM_IntersDelayP
                                  ? (console.log("ChaoQiGameSDK", "插屏延迟时间(ms):" + this.NUM_IntersDelayTime),
                                    setTimeout(function () {
                                        e.showNativeInters();
                                    }, this.NUM_IntersDelayTime))
                                  : this.showNativeInters())
                            : console.log("ChaoQiGameSDK", "系统插屏开关和原生插屏开关都没有打开");
                }
            }),
            (e.prototype.getVideoFlag = function () {
                return this.loadSucc_Video;
            }),
            (e.prototype.showVideo = function (e) {
                this.videoAd && this.loadSucc_Video && ((this.callback_Video = e), this.videoAd.show());
            }),
            (e.prototype.getNativeIconFlag = function () {
                return this.loadSucc_NativeOther && this.loadSucc_NativeIcon;
            }),
            (e.prototype.showNativeIcon = function (e, t, o, n) {
                var a = this;
                if (this.loadSucc_NativeIcon && this.loadSucc_NativeOther) {
                    if (this.isShow_NativeIcon) console.log("ChaoQiGameSDK", "原生icon正在展示中,请勿多次show return");
                    else {
                        (this.isShow_NativeIcon = !0), (this.param_nativeIcon = {width: e, height: t, x: o, y: n});
                        var i = this.nativeAdInfo.adId;
                        this.reportNativeAdShow(i);
                        var r = cc.director.getScene();
                        (this.node_nativeIcon = new cc.Node("icon")),
                            r.addChild(this.node_nativeIcon),
                            this.node_nativeIcon.addComponent(cc.Sprite),
                            (this.node_nativeIcon.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeAdInfo.Native_icon
                            )),
                            (this.node_nativeIcon.zIndex = 3e4),
                            (this.node_nativeIcon.width = e),
                            (this.node_nativeIcon.height = t),
                            (this.node_nativeIcon.x = o),
                            (this.node_nativeIcon.y = n),
                            "" != this.AdGroup && (this.node_nativeIcon.group = this.AdGroup);
                        var s = new cc.Node("NativeAdTip");
                        this.node_nativeIcon.addChild(s),
                            s.addComponent(cc.Sprite),
                            (s.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeOtherRes.NativeAdTip
                            )),
                            (s.width = e / 3),
                            (s.height = (s.width / 70) * 34),
                            (s.x = e / 2 - s.width / 2),
                            (s.y = t / 2 - s.height / 2);
                        var l = new cc.Node("NativeClose");
                        this.node_nativeIcon.addChild(l),
                            l.addComponent(cc.Sprite),
                            (l.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeOtherRes.NativeClose
                            )),
                            (l.width = 45),
                            (l.height = 45),
                            (l.x = -this.node_nativeIcon.width / 2 + l.width / 2),
                            (l.y = this.node_nativeIcon.height / 2 - l.width / 2);
                        var c = new cc.Node("titleLabel");
                        this.node_nativeIcon.addChild(c),
                            c.addComponent(cc.Label),
                            cc.winSize.width < cc.winSize.height
                                ? (c.getComponent(cc.Label).fontSize =
                                      (cc.view.getDesignResolutionSize().width / 1080) * 40)
                                : (c.getComponent(cc.Label).fontSize =
                                      (cc.view.getDesignResolutionSize().height / 1080) * 40),
                            this.nativeAdInfo.title.length <= 5
                                ? (c.getComponent(cc.Label).string = this.nativeAdInfo.title)
                                : (c.getComponent(cc.Label).string = ""),
                            (c.y = -t / 2 - 30),
                            (c.color = cc.color(255, 255, 255)),
                            l.on(cc.Node.EventType.TOUCH_START, function (e) {
                                a.node_nativeIcon.removeFromParent(), (a.node_nativeIcon = null), e.stopPropagation();
                            }),
                            this.node_nativeIcon.on(cc.Node.EventType.TOUCH_START, function () {
                                a.reportNativeAdClick(i);
                            }),
                            (this.timeout_updateNativeIcon = setTimeout(function () {
                                a.hideNativeIcon(),
                                    a.showNativeIcon(
                                        a.param_nativeIcon.width,
                                        a.param_nativeIcon.height,
                                        a.param_nativeIcon.x,
                                        a.param_nativeIcon.y
                                    );
                            }, 1e3 * this.NUM_NativeUpdateTime));
                    }
                } else console.log("ChaoQiGameSDK", "原生icon或资源未加载成功 return");
            }),
            (e.prototype.hideNativeIcon = function () {
                (this.isShow_NativeIcon = !1),
                    this.timeout_updateNativeIcon && clearTimeout(this.timeout_updateNativeIcon),
                    this.node_nativeIcon && (this.node_nativeIcon.removeFromParent(), (this.node_nativeIcon = null));
            }),
            (e.prototype.getNativeImageFlag = function () {
                return this.loadSucc_NativeOther && this.loadSucc_NativeImage;
            }),
            (e.prototype.showNativeImage = function (e, t, o, n) {
                var a = this;
                if (this.loadSucc_NativeImage && this.loadSucc_NativeOther) {
                    if (this.isShow_NativeImage) console.log("ChaoQiGameSDK", "原生大图正在展示中,请勿多次show");
                    else {
                        this.isShow_NativeImage = !0;
                        var i = this.nativeAdInfo.adId;
                        this.reportNativeAdShow(i);
                        var r = cc.director.getScene();
                        (this.node_nativeImage = new cc.Node("node_nativeImage")),
                            r.addChild(this.node_nativeImage),
                            this.node_nativeImage.addComponent(cc.Sprite),
                            (this.node_nativeImage.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeAdInfo.Native_BigImage
                            )),
                            (this.node_nativeImage.zIndex = 3e4),
                            (this.node_nativeImage.width = e),
                            (this.node_nativeImage.height = t),
                            (this.node_nativeImage.x = o),
                            (this.node_nativeImage.y = n),
                            "" != this.AdGroup && (this.node_nativeImage.group = this.AdGroup);
                        var s = new cc.Node("NativeAdTip");
                        this.node_nativeImage.addChild(s),
                            s.addComponent(cc.Sprite),
                            (s.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeOtherRes.NativeAdTip
                            )),
                            s.addComponent(cc.Widget),
                            (s.getComponent(cc.Widget).isAlignLeft = !0),
                            (s.getComponent(cc.Widget).isAlignTop = !0),
                            (s.getComponent(cc.Widget).left = 0),
                            (s.getComponent(cc.Widget).top = 0),
                            (s.width = e / 5),
                            (s.height = (s.width / 70) * 34);
                        var l = new cc.Node("NativeClose");
                        this.node_nativeImage.addChild(l),
                            l.addComponent(cc.Sprite),
                            (l.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                                this.nativeOtherRes.NativeClose
                            )),
                            l.addComponent(cc.Widget),
                            (l.getComponent(cc.Widget).isAlignRight = !0),
                            (l.getComponent(cc.Widget).isAlignTop = !0),
                            (l.getComponent(cc.Widget).right = 0),
                            (l.getComponent(cc.Widget).top = 0),
                            (l.width = 45),
                            (l.height = 45),
                            l.on(cc.Node.EventType.TOUCH_START, function (e) {
                                a.hideNativeImage(), e.stopPropagation();
                            }),
                            this.node_nativeImage.on(cc.Node.EventType.TOUCH_START, function () {
                                a.reportNativeAdClick(i);
                            });
                    }
                } else console.log("ChaoQiGameSDK", "原生大图或资源未加载成功 return");
            }),
            (e.prototype.hideNativeImage = function () {
                (this.isShow_NativeImage = !1),
                    this.node_nativeImage && (this.node_nativeImage.removeFromParent(), (this.node_nativeImage = null));
            }),
            (e.prototype.getNativeAdFlag = function (e) {
                return 1 == e ? this.SW_BigNative : this.SW_IconNative;
            }),
            (e.prototype.getNativeAdInfo = function (e) {
                return 1 == e ? this.firstNativeAdInfo : this.customNativeAdInfo;
            }),
            (e.prototype.reportNativeAdShow = function (e) {
                -1 != this.customNativeAdIdArray.indexOf(e)
                    ? this.customNativeAd.reportAdShow({adId: e})
                    : this.nativeAd.reportAdShow({adId: e});
            }),
            (e.prototype.reportNativeAdClick = function (e) {
                -1 != this.customNativeAdIdArray.indexOf(e)
                    ? this.customNativeAd.reportAdShow({adId: e})
                    : this.nativeAd.reportAdClick({adId: e});
            }),
            (e.prototype.getNavigateIconFlag = function () {
                return !1;
            }),
            (e.prototype.showNavigateIcon = function () {}),
            (e.prototype.hideNavigateIcon = function () {}),
            (e.prototype.getNavigateGroupFlag = function () {
                return !1;
            }),
            (e.prototype.showNavigateGroup = function () {}),
            (e.prototype.hideNavigateGroup = function () {}),
            (e.prototype.getNavigateSettleFlag = function () {
                return !1;
            }),
            (e.prototype.showNavigateSettle = function () {}),
            (e.prototype.hideNavigateSettle = function () {}),
            (e.prototype.getNavigateBoxBannerFlag = function () {
                return this.loadSucc_NavigateBoxBanner;
            }),
            (e.prototype.showNavigateBoxBanner = function () {
                this.isShow_NavigateSettle
                    ? console.log("ChaoQiGameSDK", "已经调用过showNavigateBoxBanner,请勿重复调用")
                    : ((this.isShow_NavigateSettle = !0),
                      this.loadSucc_NavigateBoxBanner &&
                          ((this.temp_hasShowBanner = this.hasShowBanner),
                          this.hideBanner(),
                          this.navigateBoxBannerAd.show()));
            }),
            (e.prototype.hideNavigateBoxBanner = function () {
                this.isShow_NavigateSettle &&
                    ((this.isShow_NavigateSettle = !1),
                    this.navigateBoxBannerAd && (this.navigateBoxBannerAd.destroy(), this.createNavigateBoxBanner()));
            }),
            (e.prototype.getNavigateBoxPortalFlag = function () {
                return this.loadSucc_NavigateBoxPortal;
            }),
            (e.prototype.showNavigateBoxPortal = function () {
                this.loadSucc_NavigateBoxPortal &&
                    ((this.temp_hasShowBanner = this.hasShowBanner),
                    this.hideBanner(),
                    (this.navigateBoxPortalAd.isDestroyed = !1),
                    this.navigateBoxPortalAd.show());
            }),
            (e.prototype.hideNavigateBoxPortal = function () {
                this.navigateBoxPortalAd &&
                    ((this.navigateBoxPortalAd.isDestroyed = !0),
                    this.navigateBoxPortalAd.destroy(),
                    this.temp_hasShowBanner && this.showBanner());
            }),
            (e.prototype.setGroup = function (e) {
                this.AdGroup = e;
            }),
            (e.prototype.hasAddDesktopFunc = function () {
                return !0;
            }),
            (e.prototype.getAddDesktopFlag = function (e) {
                qg.hasShortcutInstalled({
                    success: function (t) {
                        e(!t);
                    }
                });
            }),
            (e.prototype.addDesktop = function (e) {
                qg.installShortcut({
                    success: function () {
                        e(!0);
                    },
                    fail: function (t) {
                        console.log("ChaoQiGameSDK", "VIVO 创建桌面图标失败：", JSON.stringify(t)), e(!1);
                    },
                    complete: function () {}
                });
            }),
            (e.prototype.phoneVibrate = function (e) {
                "short" == e ? qg.vibrateShort() : "long" == e && qg.vibrateLong();
            }),
            (e.prototype.startGameVideo = function () {}),
            (e.prototype.pauseGameVideo = function () {}),
            (e.prototype.resumeGameVideo = function () {}),
            (e.prototype.stopGameVideo = function () {}),
            (e.prototype.shareVideo = function () {}),
            (e.prototype.jumpToMoreGamesCenter = function () {}),
            (e.prototype.showMoreGamesBanner = function () {}),
            (e.prototype.hideMoreGamesBanner = function () {}),
            (e.prototype.showFavoriteGuide = function () {}),
            (e.prototype.getBoxFlag = function () {
                return !1;
            }),
            (e.prototype.showAppBox = function () {}),
            (e.prototype.getBlockFlag = function () {
                return !1;
            }),
            (e.prototype.showBlock = function () {}),
            (e.prototype.hideBlock = function () {}),
            (e.prototype.getVideoIntersFlag = function () {
                return !1;
            }),
            (e.prototype.showVideoInters = function () {}),
            (e.prototype.exitTheGame = function () {}),
            (e.prototype.reportAnalytics = function () {}),
            (e.prototype.showAuthentication = function () {}),
            (e.prototype.visitorExperience = function () {}),
            (e.prototype.showNativeAd = function () {}),
            (e.prototype.getOPPOShowMoreGameFlag = function () {
                return !1;
            }),
            (e.prototype.showOPPOMoreGame = function () {}),
            (e.prototype.hasNetwork = function () {}),
            (e.prototype.showReviewAlert = function () {}),
            (e.prototype.showiOSADWithScene = function () {}),
            (e.prototype.showiOSADWithType = function () {}),
            (e.prototype.videoUIShow = function () {}),
            (e.prototype.showPrivacyAgreement = function () {}),
            (e.prototype.getErrBannerFlag = function () {
                return !1;
            }),
            (e.prototype.showErrBanner = function (e) {
                e(!1);
            }),
            (e.prototype.hideErrBanner = function () {}),
            (e.prototype.getErrVideoFlag = function () {
                return !1;
            }),
            (e.prototype.buyProps = function (e, t, o, n) {
                n(!1, "");
            }),
            (e.prototype.payComplete = function () {}),
            (e.prototype.checkBannerLoadSucc = function () {
                var e = this;
                if (
                    ((this.loadSucc_Banner =
                        (this.loadSucc_NativeBanner && (this.loadSucc_NativeIcon || this.loadSucc_NativeImage)) ||
                        this.loadSucc_SystemBanner),
                    console.log(
                        "ChaoQiGameSDK",
                        "banner加载成功?",
                        this.loadSucc_Banner,
                        ++this.NUM_CheckBannerLoadSucc
                    ),
                    this.timeout_checkBannerLoadSucc && clearTimeout(this.timeout_checkBannerLoadSucc),
                    this.loadSucc_Banner)
                )
                    this.showBanner();
                else {
                    if (this.NUM_CheckBannerLoadSucc >= this.NUM_MaxCheckBannerLoadSucc) return;
                    this.timeout_checkBannerLoadSucc = setTimeout(function () {
                        e.checkBannerLoadSucc();
                    }, 5e3);
                }
            }),
            (e.prototype.showNativeBanner = function () {
                var e = this;
                this.isShow_NativeBanner = !0;
                var t = cc.director.getScene(),
                    o = this.nativeAdInfo.adId;
                this.reportNativeAdShow(o),
                    (this.node_nativeBanner = new cc.Node("node_nativeBanner")),
                    t.addChild(this.node_nativeBanner),
                    this.node_nativeBanner.addComponent(cc.Sprite),
                    (this.node_nativeBanner.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                        this.nativeBannerRes.NativeBannerBg
                    )),
                    this.node_nativeBanner.addComponent(cc.Widget),
                    (this.node_nativeBanner.getComponent(cc.Widget).isAlignHorizontalCenter = !0),
                    (this.node_nativeBanner.getComponent(cc.Widget).isAlignBottom = !0),
                    (this.node_nativeBanner.getComponent(cc.Widget).bottom = 0),
                    cc.winSize.width < cc.winSize.height
                        ? ((this.node_nativeBanner.width = cc.winSize.width),
                          (this.node_nativeBanner.height = 0.2 * cc.winSize.width))
                        : ((this.node_nativeBanner.width = cc.winSize.width / 2),
                          (this.node_nativeBanner.height = 0.18 * this.node_nativeBanner.width)),
                    "" != this.AdGroup && (this.node_nativeBanner.group = this.AdGroup),
                    (this.node_nativeBanner.zIndex = 29999),
                    this.node_nativeBanner.on(cc.Node.EventType.TOUCH_START, function () {
                        e.reportNativeAdClick(o);
                    });
                var n = new cc.Node("adTip");
                this.node_nativeBanner.addChild(n),
                    n.addComponent(cc.Sprite),
                    (n.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeBannerRes.NativeAdTip)),
                    (n.height = 0.2 * this.node_nativeBanner.height),
                    (n.width = n.height / 0.45),
                    (n.x = this.node_nativeBanner.width / 2 - n.width / 2),
                    (n.y = this.node_nativeBanner.height / 2 - n.height / 2);
                var a = new cc.Node("bannerButton");
                if (
                    (this.node_nativeBanner.addChild(a),
                    a.addComponent(cc.Sprite),
                    (a.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                        this.nativeBannerRes.NativeBannerButton
                    )),
                    (a.width = 0.255 * this.node_nativeBanner.width),
                    (a.height = 0.351 * a.width),
                    (a.x = this.node_nativeBanner.width / 2 - 0.185 * this.node_nativeBanner.width),
                    (a.y = 0),
                    this.loadSucc_NativeImage)
                ) {
                    var i = new cc.Node("image");
                    this.node_nativeBanner.addChild(i),
                        i.addComponent(cc.Sprite),
                        (i.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeAdInfo.Native_BigImage)),
                        (i.height = this.node_nativeBanner.height),
                        (i.width = 2 * i.height),
                        (i.x = i.width / 2 - this.node_nativeBanner.width / 2),
                        (i.y = 0);
                } else if (this.loadSucc_NativeIcon) {
                    var r = new cc.Node("icon");
                    this.node_nativeBanner.addChild(r),
                        r.addComponent(cc.Sprite),
                        (r.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeAdInfo.Native_BigImage)),
                        (r.height = 0.8 * this.node_nativeBanner.height),
                        (r.width = r.height),
                        (r.x = 0.8 * r.width - this.node_nativeBanner.width / 2),
                        (r.y = 0);
                }
                var s = new cc.Node("titleLabel");
                this.node_nativeBanner.addChild(s),
                    s.addComponent(cc.Label),
                    cc.winSize.width < cc.winSize.height
                        ? (s.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().width / 1080) * 35)
                        : (s.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().height / 1080) * 35),
                    "" == this.nativeAdInfo.desc
                        ? (s.getComponent(cc.Label).string = this.nativeAdInfo.title)
                        : (s.getComponent(cc.Label).string = this.nativeAdInfo.desc),
                    (s.getComponent(cc.Label).overflow = cc.Label.Overflow.CLAMP),
                    (s.getComponent(cc.Label).horizontalAlign = cc.Label.HorizontalAlign.LEFT),
                    (s.getComponent(cc.Label).verticalAlign = cc.Label.VerticalAlign.CENTER),
                    (s.getComponent(cc.Label).lineHeight = s.getComponent(cc.Label).fontSize),
                    (s.color = cc.color(255, 0, 0)),
                    (s.width =
                        this.node_nativeBanner.width -
                        2 * this.node_nativeBanner.height -
                        a.width -
                        (0.2 * this.node_nativeBanner.height) / 0.45),
                    (s.height = this.node_nativeBanner.height),
                    (s.y = 0),
                    (s.x = -this.node_nativeBanner.width / 2 + 2.1 * this.node_nativeBanner.height + s.width / 2);
                var l = new cc.Node("NativeClose");
                this.node_nativeBanner.addChild(l),
                    l.addComponent(cc.Sprite),
                    (l.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeBannerRes.NativeClose)),
                    (l.width = 0.27 * this.node_nativeBanner.height),
                    (l.height = 0.27 * this.node_nativeBanner.height),
                    (l.x = -this.node_nativeBanner.width / 2 + l.width / 2),
                    (l.y = this.node_nativeBanner.height / 2 - l.width / 2);
                var c = new cc.Node("closeButton");
                this.node_nativeBanner.addChild(c),
                    (c.width = l.height),
                    (c.height = l.height),
                    (c.x = -this.node_nativeBanner.width / 2 + l.width / 2),
                    (c.y = this.node_nativeBanner.height / 2 - l.width / 2),
                    (c.zIndex = 29999),
                    c.on(cc.Node.EventType.TOUCH_START, function (t) {
                        e.getNativeCloseErr()
                            ? e.reportNativeAdClick(o)
                            : (console.log("ChaoQiGameSDK", "原生banner关闭", e.NUM_BannerUpdateTime + "S后再次刷新"),
                              e.NUM_BannerClose++,
                              e.hideBanner(),
                              t.stopPropagation());
                    });
            }),
            (e.prototype.showSystemBanner = function () {
                var e = this;
                this.bannerAd
                    ? ((this.isShow_SystemBanner = !0), this.bannerAd.show())
                    : (this.createSystemBanner(),
                      (this.timeout_showSystemBanner = setTimeout(function () {
                          e.bannerAd && e.showSystemBanner();
                      }, 1e3)));
            }),
            (e.prototype.updateBanner = function () {
                var e = this;
                if (this.NUM_BannerMostShow <= this.NUM_BannerClose)
                    return (
                        console.log(
                            "ChaoQiGameSDK",
                            "banner最大关闭(最多展示)次数",
                            this.NUM_BannerMostShow,
                            " 已达上限 return"
                        ),
                        void (this.interval_updateBanner && clearInterval(this.interval_updateBanner))
                    );
                this.interval_updateBanner && clearInterval(this.interval_updateBanner),
                    (this.interval_updateBanner = setInterval(function () {
                        if (e.NUM_BannerMostShow <= e.NUM_BannerClose)
                            return (
                                console.log(
                                    "ChaoQiGameSDK",
                                    "banner最大关闭(最多展示)次数",
                                    e.NUM_BannerMostShow,
                                    " 已达上限 return"
                                ),
                                void (e.interval_updateBanner && clearInterval(e.interval_updateBanner))
                            );
                        e.SW_SystemBanner && e.SW_NativeBanner
                            ? e.SW_SystemBannerFirst
                                ? e.loadSucc_SystemBanner
                                    ? e.updateSystemBanner()
                                    : e.loadSucc_NativeBanner && e.updateNativeBanner()
                                : e.loadSucc_NativeBanner
                                ? e.updateNativeBanner()
                                : e.loadSucc_SystemBanner && e.updateSystemBanner()
                            : e.SW_SystemBanner
                            ? e.updateSystemBanner()
                            : e.SW_NativeBanner && e.updateNativeBanner();
                    }, 1e3 * this.NUM_BannerUpdateTime));
            }),
            (e.prototype.updateSystemBanner = function () {
                var e = this;
                this.hideNativeBanner(),
                    this.hideSystemBanner(),
                    this.createSystemBanner(),
                    (this.timeout_showSystemBanner = setTimeout(function () {
                        e.bannerAd && e.showSystemBanner();
                    }, 1e3));
            }),
            (e.prototype.hideSystemBanner = function () {
                this.isShow_SystemBanner && this.bannerAd && ((this.isShow_SystemBanner = !1), this.bannerAd.destroy());
            }),
            (e.prototype.updateNativeBanner = function () {
                this.hideNativeBanner(), this.hideSystemBanner(), this.showNativeBanner();
            }),
            (e.prototype.hideNativeBanner = function () {
                (this.isShow_NativeBanner = !1),
                    this.node_nativeBanner &&
                        (this.node_nativeBanner.removeFromParent(), (this.node_nativeBanner = null));
            }),
            (e.prototype.showSystemInters = function () {
                this.systemIntersAd &&
                    this.loadSucc_SystemInters &&
                    this.systemIntersAd
                        .show()
                        .then(function () {
                            console.log("ChaoQiGameSDK", "VIVO 系统插屏广告展示成功==================");
                        })
                        .catch(function (e) {
                            console.log("ChaoQiGameSDK", "VIVO 系统插屏展示错误:" + JSON.stringify(e));
                        });
            }),
            (e.prototype.showCustomInters = function () {
                this.customIntersAd &&
                    this.loadSucc_CuctomInters &&
                    this.customIntersAd
                        .show()
                        .then(function () {
                            console.log("ChaoQiGameSDK", "VIVO 原生模板插屏广告展示成功==================");
                        })
                        .catch(function (e) {
                            console.log("ChaoQiGameSDK", "VIVO 原生模板插屏展示错误:" + JSON.stringify(e));
                        });
            }),
            (e.prototype.showNativeInters = function () {
                var e = this;
                this.node_nativeInters && (this.node_nativeInters.removeFromParent(), (this.node_nativeInters = null));
                var t = this.nativeAdInfo.adId;
                this.reportNativeAdShow(t);
                var o = cc.director.getScene();
                (this.node_nativeInters = new cc.Node("node_nativeInters")),
                    o.addChild(this.node_nativeInters),
                    (this.node_nativeInters.zIndex = 30003),
                    (this.node_nativeInters.width = 2560),
                    (this.node_nativeInters.height = 2560),
                    (this.node_nativeInters.x = cc.winSize.width / 2),
                    (this.node_nativeInters.y = cc.winSize.height / 2),
                    "" != this.AdGroup && (this.node_nativeInters.group = this.AdGroup),
                    this.node_nativeInters.on(cc.Node.EventType.TOUCH_START, function () {});
                var n = new cc.Node("NativeInterMask");
                this.node_nativeInters.addChild(n),
                    n.addComponent(cc.Sprite),
                    (n.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeIntersRes.NativeInterMask)),
                    (n.width = this.node_nativeInters.width),
                    (n.height = this.node_nativeInters.height),
                    (n.opacity = 150);
                var a = new cc.Node("NativeIntersBg");
                this.node_nativeInters.addChild(a),
                    a.addComponent(cc.Sprite),
                    (a.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeIntersRes.NativeIntersBg));
                var i = new cc.Node("NativeIntersButton");
                a.addChild(i),
                    i.addComponent(cc.Sprite),
                    (i.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                        this.nativeIntersRes.NativeIntersButton
                    )),
                    cc.winSize.width < cc.winSize.height
                        ? ((a.width = 0.9 * cc.winSize.width),
                          (a.height = 0.9 * a.width),
                          (a.y = 0.05 * cc.winSize.height),
                          (i.width = 0.55 * a.width),
                          (i.height = 0.35 * i.width),
                          (i.y = -a.height / 2 - i.height / 2 - 0.3 * i.height))
                        : ((a.y = 50),
                          (a.height = 0.8 * cc.winSize.height),
                          (a.width = 1.15 * a.height),
                          (i.scale = 0.7),
                          (i.y = -a.height / 2 + i.height / 2 - 0.1 * i.height)),
                    i.on(cc.Node.EventType.TOUCH_START, function () {
                        e.reportNativeAdClick(t);
                    }),
                    a.on(cc.Node.EventType.TOUCH_START, function () {
                        e.reportNativeAdClick(t);
                    });
                var r = new cc.Node("titleLabel");
                a.addChild(r),
                    r.addComponent(cc.Label),
                    (r.getComponent(cc.Label).horizontalAlign = cc.Label.HorizontalAlign.CENTER),
                    (r.getComponent(cc.Label).verticalAlign = cc.Label.VerticalAlign.CENTER),
                    cc.winSize.width < cc.winSize.height
                        ? (r.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().width / 1080) * 50)
                        : (r.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().height / 1080) * 45),
                    (r.getComponent(cc.Label).lineHeight = r.getComponent(cc.Label).fontSize),
                    (r.color = cc.color(204, 124, 112)),
                    this.nativeAdInfo.title.length >= 5 &&
                        (this.nativeAdInfo.title = this.nativeAdInfo.title.substring(0, 5)),
                    (r.getComponent(cc.Label).string = this.nativeAdInfo.title),
                    (r.y = a.height / 2 - r.height / 2 - 0.06 * a.height),
                    this.nativeAdInfo.desc.length >= 20 &&
                        (this.nativeAdInfo.desc = this.nativeAdInfo.desc.substring(0, 20));
                var s = new cc.Node("descLabel");
                if (
                    (a.addChild(s),
                    s.addComponent(cc.Label),
                    (s.getComponent(cc.Label).horizontalAlign = cc.Label.HorizontalAlign.CENTER),
                    (s.getComponent(cc.Label).verticalAlign = cc.Label.VerticalAlign.CENTER),
                    (s.getComponent(cc.Label).overflow = cc.Label.Overflow.SHRINK),
                    (s.width = 420),
                    (s.height = 60),
                    (s.getComponent(cc.Label).string = this.nativeAdInfo.desc),
                    cc.winSize.width < cc.winSize.height
                        ? (s.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().width / 1080) * 35)
                        : (s.getComponent(cc.Label).fontSize = (cc.view.getDesignResolutionSize().height / 1080) * 30),
                    (s.getComponent(cc.Label).lineHeight = s.getComponent(cc.Label).fontSize),
                    (s.color = cc.color(153, 124, 112)),
                    (s.y = a.height / 2 - s.height / 2 - 0.16 * a.height),
                    this.loadSucc_NativeImage)
                ) {
                    var l = new cc.Node("bigImage");
                    a.addChild(l),
                        l.addComponent(cc.Sprite),
                        (l.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeAdInfo.Native_BigImage)),
                        (l.width = 0.95 * a.height),
                        (l.height = l.width / 2),
                        (l.y = l.height / 2 - 0.25 * a.height);
                } else if (this.loadSucc_NativeIcon) {
                    var c = new cc.Node("icon");
                    a.addChild(c),
                        c.addComponent(cc.Sprite),
                        (c.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(this.nativeAdInfo.Native_icon)),
                        (c.height = 0.55 * a.height),
                        (c.width = c.height),
                        (c.y = c.height / 2 - 0.4 * a.height);
                }
                var d = new cc.Node("NativeIntersClose");
                a.addChild(d),
                    d.addComponent(cc.Sprite),
                    (d.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(
                        this.nativeIntersRes.NativeIntersClose
                    )),
                    (d.zIndex = 30010),
                    (d.x = a.width / 2 - ((d.width / 2) * 1.25 * a.width) / 1080 - 0.02 * a.width),
                    (d.y = a.height / 2 - ((d.width / 2) * 1.25 * a.width) / 1080 - 0.03 * a.width),
                    (d.scale = a.width / 1080),
                    d.on(cc.Node.EventType.TOUCH_START, function (o) {
                        e.getNativeCloseErr()
                            ? e.reportNativeAdClick(t)
                            : ((e.NUM_IntersNowIntervalTime = 0),
                              e.node_nativeInters.removeFromParent(),
                              (e.node_nativeInters = null),
                              o.stopPropagation());
                    });
            }),
            (e.prototype.getNativeCloseErr = function () {
                var e = !1;
                return (
                    this.inter_Err_Num++,
                    0 != this.inter_Err_Num &&
                        (null != this.InterErrSwitch &&
                            this.InterErrSwitch.inter_switch &&
                            (this.InterErrSwitch.trigger_number > 0
                                ? this.inter_Err_Num >= this.InterErrSwitch.trigger_number &&
                                  ((e = !0), (this.inter_Err_Num = -1))
                                : this.InterErrSwitch.trigger_prob > 0
                                ? Math.floor(100 * Math.random()) < this.InterErrSwitch.trigger_prob && (e = !0)
                                : 0 == this.InterErrSwitch.trigger_number &&
                                  0 == this.InterErrSwitch.trigger_prob &&
                                  (e = !0)),
                        e)
                );
            }),
            (e.prototype.nativeAdAutoUpdate = function () {
                var e = this;
                setInterval(function () {
                    e.nativeAd && e.nativeAd.load();
                }, 1e3 * this.NUM_NativeUpdateTime);
            }),
            (e.prototype.customNativeAdAutoUpdate = function () {
                var e = this;
                setInterval(function () {
                    e.customNativeAd && e.customNativeAd.load();
                }, 1e3 * this.NUM_NativeUpdateTime);
            }),
            (e.prototype.runIntersInterval = function () {
                var e = this;
                this.NUM_IntersIntervalTime > 0 &&
                    setInterval(function () {
                        e.NUM_IntersNowIntervalTime++;
                    }, 1e3);
            }),
            e
        );
    })();
o.default = i;
